﻿<Window x:Class="Wimat.Collections.Example.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="400">
    <TabControl>
        <TabItem Header="LazyCurrentCollection">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0"
                   Text="Delay[ms]:" />
                <TextBlock Grid.Row="1" Grid.Column="0"
                   Text="Bound items:" />
                <TextBlock Grid.Row="2" Grid.Column="0"
                   Text="Bound LazyCurrent:" />
                <Slider Grid.Row="0" Grid.Column="1"
                Minimum="100" Maximum="1000" 
                AutoToolTipPlacement="TopLeft"
                TickPlacement="Both" TickFrequency="50"
                Value="{Binding Lazy.LazyCurrentChangedDelay}"></Slider>
                <ListBox Grid.Row="1" Grid.Column="1"
            ItemsSource="{Binding Lazy}" IsSynchronizedWithCurrentItem="True"></ListBox>
                <TextBlock Grid.Row="2" Grid.Column="1"
                   Text="{Binding Lazy.LazyCurrent}"></TextBlock>
            </Grid>
        </TabItem>
        <TabItem Header="RandomizedCollection">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.ColumnSpan="2"
                    Orientation="Horizontal" >
                    <Button Click="Button_Click">Randomize</Button>
                    <Slider Width="150" Minimum="1" Maximum="10" 
                            AutoToolTipPlacement="TopLeft"
                            TickPlacement="Both" TickFrequency="1"
                            Value="{Binding Randomized.RandomizedExpectedCount}"></Slider>
                </StackPanel>
                <ListView Grid.Row="1" Grid.Column="0"
                          ItemsSource="{Binding Randomized}">
                </ListView>
                <ListView Grid.Row="1" Grid.Column="1"
                          ItemsSource="{Binding Randomized.Randomized}">
                </ListView>
            </Grid>
        </TabItem>
        <TabItem Header="SplitCollection">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="1" Grid.Column="1">
                    <Button Click="Button_Click_1">--&gt;</Button>
                    <Button Click="Button_Click_2">&lt;--</Button>
                </StackPanel>
                <ListView Grid.Row="1" Grid.Column="0"
                          ItemsSource="{Binding Split.Source}"
                          IsSynchronizedWithCurrentItem="True">
                </ListView>
                <ListView Grid.Row="1" Grid.Column="2"
                          ItemsSource="{Binding Split.Result}"
                          IsSynchronizedWithCurrentItem="True">
                </ListView>
            </Grid>
        </TabItem>
    </TabControl>
</Window>
